package com.zui.entity.product;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.zui.entity.BaseAssignedIdEntity;





@Entity
@Table(name="product_type")
public class ProductType extends BaseAssignedIdEntity {
	private static final long serialVersionUID = 1L;
	
	public static final String TYPE_FINISHED_GOOD = "FINISHED_GOOD";
	
	public ProductType() {}
	public ProductType(String id) {
		this.id = id;
	}
	
	private String name;
	private String nameEn;
	private ProductType parentProductType;
	private String hasTable;
	private String isPhysical;
	private String isDigital;

	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	@Column(length=20)
	public String getName() {return name;}
	@Column(length=20)
	public String getNameEn() {
		return nameEn;
	}

	@ManyToOne
	@JoinColumn(name="parentProductTypeId")
	public ProductType getParentProductType() {return parentProductType;}
	
	@Column(length=1)
	public String getHasTable() {return hasTable;}
	@Column(length=1)
	public String getIsPhysical() {return isPhysical;}
	@Column(length=1)
	public String getIsDigital() {return isDigital;}
	
	public void setIsPhysical(String isPhysical) {
		this.isPhysical = isPhysical;
	}
	public void setIsDigital(String isDigital) {
		this.isDigital = isDigital;
	}
	public void setName(String name) {
		this.name = name;
	}

	public void setNameEn(String nameEn) {
		this.nameEn = nameEn;
	}
	public void setParentProductType(ProductType parentProductType) {
		this.parentProductType = parentProductType;
	}

	public void setHasTable(String hasTable) {
		this.hasTable = hasTable;
	}
}
